import request from '@/config/axios'

export interface TradeRefundVO {
  id: number
  no: string
  userId: number
  activeNo: string
  activeName: string
  applyReason: string
  applyDescription: string
  applyPicUrls: string
  orderNo: string
  auditTime: Date
  auditUserId: number
  auditReason: string
  payRefundId: number
  refundTime: Date
  type: number
  status: number
  orderId: number
  refundPrice: number
  rejectReason: string
}

// 查询相亲订单退款列表
export const getTradeRefundPage = async (params) => {
  return await request.get({ url: `/order/blind-trade-refund/page`, params })
}

// 查询相亲订单退款详情
export const getTradeRefund = async (id: number) => {
  return await request.get({ url: `/order/blind-trade-refund/get?id=` + id })
}

// 新增相亲订单退款
export const createTradeRefund = async (data: TradeRefundVO) => {
  return await request.post({ url: `/order/blind-trade-refund/create`, data })
}

// 修改相亲订单退款
export const updateTradeRefund = async (data: TradeRefundVO) => {
  return await request.put({ url: `/order/blind-trade-refund/update`, data })
}

// 删除相亲订单退款
export const deleteTradeRefund = async (id: number) => {
  return await request.delete({ url: `/order/blind-trade-refund/delete?id=` + id })
}

// 导出相亲订单退款 Excel
export const exportTradeRefund = async (params) => {
  return await request.download({ url: `/order/blind-trade-refund/export-excel`, params })
}

// 新增相亲订单退款
export const getCloseActivityInfo = async (data) => {
  return await request.post({ url: `/order/blind-trade-refund/getCloseActivityInfo`, data })
}

// 活动退款审核
export const auditTradeRefund = async (data: TradeRefundVO) => {
  return await request.post({ url: `/order/blind-trade-refund/auditTradeRefund`, data })
}